package com.zxkj.domain.entity;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import java.io.Serializable;

/**
 * Created by Administrator on 2017/8/3.
 */
@Embeddable
public class SciMapUtDoiPK implements Serializable {
    public SciMapUtDoiPK() {
    }

    public SciMapUtDoiPK(String ut, String doi) {
        this.ut = ut;
        this.doi = doi;
    }

    private static final long serialVersionUID = -2432145316543676L;
    @Column(nullable = false)
    private String ut;
    @Column(nullable = false)
    private String doi;

    public String getUt() {
        return ut;
    }

    public void setUt(String ut) {
        this.ut = ut;
    }

    public String getDoi() {
        return doi;
    }

    public void setDoi(String doi) {
        this.doi = doi;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SciMapUtDoiPK that = (SciMapUtDoiPK) o;

        if (ut != null ? !ut.equals(that.ut) : that.ut != null) return false;
        return doi != null ? doi.equals(that.doi) : that.doi == null;
    }

    @Override
    public int hashCode() {
        int result = ut != null ? ut.hashCode() : 0;
        result = 31 * result + (doi != null ? doi.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "SciMapUtDoiPK{" +
                "ut='" + ut + '\'' +
                ", doi='" + doi + '\'' +
                '}';
    }
}
